package edu.bluebeanforum.mapper;

import edu.bluebeanforum.model.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message row);

    int insertSelective(Message row);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message row);

    int updateByPrimaryKey(Message row);


    //根据用户id获取用户未读数
    Integer selectUnreadCount(@Param("receiveUserId") Long receiveUserId);
    //根据接受者用户id查询所有的站内信
    List<Message> selectByReceiveUserId(@Param("receiveUserId") Long receiveUserId);
}